package com.demo.studentmanager.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.studentmanager.dao.CourseMapper;
import com.demo.studentmanager.dto.CourseListDto;
import com.demo.studentmanager.entity.Course;
import com.demo.studentmanager.service.ICourseService;
import com.demo.studentmanager.vo.CourseVO;
import org.springframework.stereotype.Service;

/**
 * @author ZHB
 * @version 1.0.0
 * @date Create in 2020/11/19
 */
@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements ICourseService {
    @Override
    public IPage<CourseVO> getCourseList(CourseListDto courseListDto) {
        Page<CourseVO> page = new Page<>(courseListDto.getCurrent(), courseListDto.getSize());
        return baseMapper.getCourseList(page, courseListDto);
    }
}
